//
//  PressBaseBtn.m
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.
//

#import "PressBaseBtn.h"

// MARK: 按钮点击开始和点击结束回调block

@implementation PressBaseBtn

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    if(_touchBeginBlock)
    {
        __weak typeof(self) weakSelf = self;
        
        _touchBeginBlock(weakSelf);
    }
    [super touchesBegan:touches withEvent:event];
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    if(_touchEndBlock)
    {
        __weak typeof(self) weakSelf = self;
        
        _touchEndBlock(weakSelf);
    }
    [super touchesEnded:touches withEvent:event];
}

@end
